package com.example.springbootwebrestfulcrud.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * @Auther: luzhanshi
 * @Date: 2021/2/27 - 02 - 27 - 15:23 
 * @Description: com.example.springbootwebrestfulcrud.filter
 * @version: 1.0
 */
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("servlet过滤器初始化");
    }

    @Override
    public void destroy() {
        System.out.println("servlet过滤器销毁");


    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("servlet过滤器执行");
        filterChain.doFilter(servletRequest,servletResponse);
    }
}
